create proc proc_revokeAllProc(@userid nvarchar(200))
as
begin
	declare @object varchar(40) 
	declare mycursor scroll cursor 
	for 
	   select name from sysobjects 
	   where type = 'p' 
	   order by name 
	  
	open mycursor 
	fetch first from mycursor into @object 

	while @@fetch_status <> -1 
	begin 
	  if @@fetch_status <> -2 
	  begin 
		 exec('revoke all on '+@object+' to '+@userid) 
	  end 
	  fetch next from mycursor into @object 
	end
	 
	close mycursor 
	deallocate mycursor
end

create proc proc_grantAllProc(@userid nvarchar(200))
as
begin
	declare @object varchar(40) 
	declare mycursor scroll cursor 
	for 
	   select name from sysobjects 
	   where type = 'u'
	   order by name 
	  
	open mycursor 
	fetch first from mycursor into @object 

	while @@fetch_status <> -1 
	begin 
	  if @@fetch_status <> -2 
	  begin 
		 exec('grant all on '+@object+' to '+@userid) 
	  end 
	  fetch next from mycursor into @object 
	end
	 
	close mycursor 
	deallocate mycursor
end